package com.woniu.outlet.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.woniu.intlet.web.jsr303.PurchasePoJsr;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
public class ProPlanPo {
    @ApiModelProperty(value = "生产计划单id")
    private Long id;
    @ApiModelProperty(value = "生产计划单号")
    private Long planNo;
    @ApiModelProperty(value = "订单号")
    private Long orderId;

    @ApiModelProperty(value = "生产要点")
    @NotNull(message = "生产要点不能为空",groups = {PurchasePoJsr.class})
    private String keyPoint;

    @ApiModelProperty(value = "备注")
    @NotNull(message = "备注要点不能为空",groups = {PurchasePoJsr.class})
    private String remark;

    @ApiModelProperty(value = "开始时间",example = "1997-01-01 00:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "开始日期不能为空",groups = {PurchasePoJsr.class})
    private Date startTime;

    @ApiModelProperty(value = "截至时间",example = "1997-01-01 00:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "结束日期不能为空",groups = {PurchasePoJsr.class})
    private Date endTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "交货日期",example = "1997-01-01 00:00:00")
    @NotNull(message = "截至日期不能为空",groups = {PurchasePoJsr.class})
    private Date dueday;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "备用")
    private String spare3;

    @ApiModelProperty(value = "优先级")
    @NotNull(message = "优先级不能为空",groups = {PurchasePoJsr.class})
    private String spare1;

    @ApiModelProperty(value = "备用")
    private String spare2;

    @ApiModelProperty(value = "创建人")
    private String createPerson;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改人")
    private String fixPerson;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "修改时间")
    private Date fixTime;

    @ApiModelProperty(value = "客户名称")
    @NotNull(message = "客户名称不能为空",groups = {PurchasePoJsr.class})
    private String customer;

    @ApiModelProperty(value = "联系人")
    @NotNull(message = "联系人不能为空",groups = {PurchasePoJsr.class})
    private String contacts;

    @ApiModelProperty(value = "联系电话")
    @NotNull(message = "联系电话不能为空",groups = {PurchasePoJsr.class})
    private String contactsTel;

}